#include <stdio.h>
#include "../../src/gtthread.h"
#include <stdint.h>

char g_str[] = "hello world\n";

gtthread_t g_th1, g_th2;

gtthread_mutex_t g_mutex1;

void* worker(void* arg)
{
	volatile int k=0;
	int i;

	for(i=0;i<5;i++)
	{
		printf("thread %d\n", (intptr_t)arg);
		gtthread_yield();
	}
}

int main()
{
	volatile int i=0;
	void* ret;

	gtthread_init(1000);

	gtthread_mutex_init(&g_mutex1);

	gtthread_create(&g_th1, worker, (void*)1);
	gtthread_create(&g_th2, worker, (void*)2);

	gtthread_join(g_th1, NULL);
	gtthread_join(g_th2, NULL);

}
